package com.hand.wyc24548.domain.entity;

import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.validation.constraints.NotBlank;

import com.fasterxml.jackson.annotation.JsonInclude;
import io.choerodon.mybatis.annotation.ModifyAudit;
import io.choerodon.mybatis.annotation.VersionAudit;
import io.choerodon.mybatis.domain.AuditDomain;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.hibernate.validator.constraints.Length;

/**
 * @Author wangyc
 * @create 2019/8/5 16:52
 */

@ApiModel("公司信息")
@ModifyAudit  //在类上使用，启用审计字段支持，实体类加上该注解后，插入和更新会启动对 lastUpdateDate、lastUpdatedBy 自维护字段支持
@VersionAudit  //在类上使用，启用objectVersionNumber自维护支持，插入一条数据objectVersionNumber默认为1，每次update后objectVersionNumber自增1
@Table(name = "hodr_company")
@JsonInclude(JsonInclude.Include.NON_NULL)
public class Company extends AuditDomain {

    @Id
    @GeneratedValue
    @ApiModelProperty("公司ID")
    private Long companyId;
    @Length(max = 60) // 长度控制
    @NotBlank // 非空控制
    @ApiModelProperty("公司编号") // Swagger 字段描述
    private String companyNumber;
    @NotBlank
    @ApiModelProperty("公司名称")
    private String companyName;
    @Length(max = 1)
    @ApiModelProperty("启用标识")
    private boolean enabledFlag;

    public Long getCompanyId() {
        return companyId;
    }

    public void setCompanyId(Long companyId) {
        this.companyId = companyId;
    }

    public String getCompanyNumber() {
        return companyNumber;
    }

    public void setCompanyNumber(String companyNumber) {
        this.companyNumber = companyNumber;
    }

    public String getCompanyName() {
        return companyName;
    }

    public void setCompanyName(String companyName) {
        this.companyName = companyName;
    }

    public boolean isEnabledFlag() {
        return enabledFlag;
    }

    public void setEnabledFlag(boolean enabledFlag) {
        this.enabledFlag = enabledFlag;
    }

}
